package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the REPAIR_PLAN database table.
 * 
 */
@Entity
@Table(name="REPAIR_PLAN")
@NamedQuery(name="RepairPlan.findAll", query="SELECT r FROM RepairPlan r")
public class RepairPlan implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="RPLAN_ID")
	private long rplanId;

	@Column(name="RPLAN_CHECK")
	private String rplanCheck;

	@Temporal(TemporalType.DATE)
	@Column(name="RPLAN_DATE")
	private Date rplanDate;

	@Column(name="RPLAN_RESPON")
	private String rplanRespon;

	@Column(name="RPLAN_TITLE")
	private String rplanTitle;

	//bi-directional many-to-one association to RepairDatail
	@OneToMany(mappedBy="repairPlan")
	private List<RepairDatail> repairDatails;

	public RepairPlan() {
	}

	public long getRplanId() {
		return this.rplanId;
	}

	public void setRplanId(long rplanId) {
		this.rplanId = rplanId;
	}

	public String getRplanCheck() {
		return this.rplanCheck;
	}

	public void setRplanCheck(String rplanCheck) {
		this.rplanCheck = rplanCheck;
	}

	public Date getRplanDate() {
		return this.rplanDate;
	}

	public void setRplanDate(Date rplanDate) {
		this.rplanDate = rplanDate;
	}

	public String getRplanRespon() {
		return this.rplanRespon;
	}

	public void setRplanRespon(String rplanRespon) {
		this.rplanRespon = rplanRespon;
	}

	public String getRplanTitle() {
		return this.rplanTitle;
	}

	public void setRplanTitle(String rplanTitle) {
		this.rplanTitle = rplanTitle;
	}

	public List<RepairDatail> getRepairDatails() {
		return this.repairDatails;
	}

	public void setRepairDatails(List<RepairDatail> repairDatails) {
		this.repairDatails = repairDatails;
	}

	public RepairDatail addRepairDatail(RepairDatail repairDatail) {
		getRepairDatails().add(repairDatail);
		repairDatail.setRepairPlan(this);

		return repairDatail;
	}

	public RepairDatail removeRepairDatail(RepairDatail repairDatail) {
		getRepairDatails().remove(repairDatail);
		repairDatail.setRepairPlan(null);

		return repairDatail;
	}

}